# coding:utf-8

from lib.base_ios import Base

from page.ios import train_select_train_number_page, train_feedback_page, train_luggage_send_page, \
    train_taxi_shuttle_page, train_select_hotel_page, train_travel_service_page, train_index_page, \
    train_verification_strategy_page

__author__ = 'weixin.yuan'


class TrainTravelService(Base):
    """旅行服务"""
    def __init__(self, method_name):
        Base.__init__(self, method_name)

        """
        本页元素
        """
        self.select_train_btn = train_travel_service_page.elements['车次查询按钮']
        self.luggage_btn = train_travel_service_page.elements['行李寄送按钮']
        self.hotel_btn = train_travel_service_page.elements['精品酒店按钮']
        self.taxi_btn = train_travel_service_page.elements['专车接送按钮']
        self.verification_btn = train_travel_service_page.elements['核验攻略按钮']
        self.feedback_btn = train_travel_service_page.elements['意见反馈按钮']

        """
        外部页面元素
        """
        self.travel_service_btn = train_index_page.elements['旅行服务']
        self.feedback_title = train_feedback_page.elements['意见反馈title']
        self.luggage_send_title = train_luggage_send_page.elements['同城行李寄送title']
        self.select_hotle_title = train_select_hotel_page.elements['开始搜索title']
        self.taxi_shttle_title = train_taxi_shuttle_page.elements['立即查询title']
        self.select_train_number_title = train_select_train_number_page.elements['车次查询title']
        self.verification_strategy_title = train_verification_strategy_page.elements['核验攻略title']

    def test_travel_service(self):
        """旅行服务页面check"""
        self.open_schema_ios('6002')
        self.click(self.travel_service_btn)

        self.click(self.select_train_btn)
        self.check(self.select_train_number_title)
        self.back()

        self.click(self.luggage_btn)
        self.check(self.luggage_send_title)
        self.back()

        self.click(self.hotel_btn)
        self.check(self.select_hotle_title)
        self.back()

        self.click(self.feedback_btn)
        self.check(self.feedback_title)
        self.back()

        self.click(self.taxi_btn)
        self.check(self.taxi_shttle_title)
        self.back()

        self.click(self.verification_btn)
        self.check(self.verification_strategy_title)
        self.back()